home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-0039 / source / dcglobal.def < prev    next >
Text File  |  1997-04-16  |  8KB  |  197 lines

  1. DEFINITION MODULE DCGlobal;
  2.  
  3. (*--------------------------------------------------------------------*)
  4. (*                                                                    *)
  5. (*  This Module contains GLOBAL DATA TYPES used in the conversion     *)
  6. (*  modules.                                                          *)
  7. (*                                                                    *)
  8. (*--------------------------------------------------------------------*)
  9.  
  10. (*--------------------------------------------------------------------*)
  11. (*  23/ 9/89 LGM - Redefine screen as bytes for use by expansion      *)
  12. (*                 routines.                          *)
  13. (*  22/ 8/89 LGM - Add pointer types to pixel groups.                 *)
  14. (*  10/ 9/89 LGM - Add TheWindow - use ManyWindows.                   *)
  15. (*                                                                    *)
  16. (*                   2.00         July   1988     L.G.Miller          *)
  17. (*                                                                    *)
  18. (*                   1.10         August 1987     L.G.Miller          *)
  19. (*                   1.00         April 1987      L.G.Miller          *)
  20. (*--------------------------------------------------------------------*)
  21.  
  22.  
  23. FROM SYSTEM         IMPORT WORD ;
  24. FROM ManyWindows    IMPORT WindowPtr;
  25.  
  26. (*  ------------- Types related to the Hardware -------------- *)
  27. CONST
  28.   LowRes = 0;
  29.   MedRes = 1;
  30.   HiRes  = 2;
  31.  
  32.   LowResMaxX        =  319;  
  33.   LowResMaxY        =  199;  
  34.   LowResNoPlanes    =  4;
  35.  
  36.   MedResMaxX        =  639;
  37.   MedResMaxY        =  199;
  38.   MedResNoPlanes    =  2;  
  39.  
  40.   HiResMaxX         =  639;  
  41.   HiResMaxY         =  399;  
  42.   HiResNoPlanes     =  1;
  43.  
  44.   BITSPERWORD         = 16;
  45.  
  46. TYPE
  47.   (* PRINTERS *)
  48.  
  49.   PrinterTypes = (EpsonMX80, EpsonFX80, EpsonLQ80);
  50.  
  51.   (*-----------------------------------------------------------------*)
  52.   (*               Hardware display types                            *)
  53.   (*-----------------------------------------------------------------*)
  54.   
  55.   Palette = ARRAY [ 0 .. 15 ] OF CARDINAL;
  56.  
  57.   BitPlanesEnum = (BitPlane1, BitPlane2, BitPlane3, BitPlane4);
  58.  
  59.         (*------------------------------------*)
  60.         (*  Low-res screen - 4 planes         *)
  61.         (*------------------------------------*)  
  62.  
  63.   LowRes16Pixels       = ARRAY [ BitPlane1 .. BitPlane4 ] OF BITSET;
  64.   LowResLinePixelGroups = [ 0 ..  LowResMaxX DIV BITSPERWORD  ];
  65.   LowResScreenLine     = ARRAY  LowResLinePixelGroups OF LowRes16Pixels;
  66.   LowResScreen         = ARRAY [ 0 .. LowResMaxY ] OF LowResScreenLine;
  67.  
  68.   LowRes16PixelsPtr       = POINTER TO LowRes16Pixels;
  69.   LowResPixelGroupPtr    = POINTER TO LowResLinePixelGroups;
  70.   LowResScreenLinePtr     = POINTER TO LowResScreenLine;
  71.  
  72.   LowResCharPlane      = ARRAY [ BitPlane1 .. BitPlane4 ] 
  73.                     OF ARRAY [ 0 .. 1 ] OF CHAR;
  74.   LowResCharScreenLine    = ARRAY  LowResLinePixelGroups OF LowResCharPlane;
  75.   LowResCharScreen         = ARRAY [ 0 .. LowResMaxY ] OF LowResCharScreenLine;
  76.  
  77.         (*------------------------------------*)
  78.         (*  Med-res screen - 2 planes         *)
  79.         (*------------------------------------*)  
  80.  
  81.   MedRes16Pixels       = ARRAY [ BitPlane1 .. BitPlane2 ] OF BITSET;
  82.   MedResLinePixelGroups = [ 0 .. ( MedResMaxX DIV BITSPERWORD ) ];
  83.   MedResScreenLine     = ARRAY  MedResLinePixelGroups OF MedRes16Pixels;
  84.   MedResScreen         = ARRAY [ 0 .. MedResMaxY ] OF MedResScreenLine;
  85.  
  86.   MedRes16PixelsPtr       = POINTER TO MedRes16Pixels;
  87.   MedResPixelGroupPtr   = POINTER TO MedResLinePixelGroups;
  88.   MedResScreenLinePtr     = POINTER TO MedResScreenLine;
  89.  
  90.   MedResCharPlane      = ARRAY [ BitPlane1 .. BitPlane2 ] OF 
  91.                     ARRAY [ 0 .. 1 ] OF CHAR;
  92.   MedResCharScreenLine    = ARRAY  MedResLinePixelGroups OF MedResCharPlane;
  93.   MedResCharScreen    = ARRAY [ 0 .. MedResMaxY ] OF MedResCharScreenLine;
  94.  
  95.         (*------------------------------------*)
  96.         (*  Hi-res screen - 1 plane           *)
  97.         (*------------------------------------*)  
  98.  
  99.   HiRes16Pixels        = BITSET;
  100.   HiResLinePixelGroups     = [ 0 .. ( HiResMaxX DIV BITSPERWORD ) ];
  101.   HiResScreenLine      = ARRAY  HiResLinePixelGroups OF HiRes16Pixels;
  102.   HiResScreen          = ARRAY [ 0 .. HiResMaxY ] OF HiResScreenLine;
  103.  
  104.   HiRes16PixelsPtr       = POINTER TO HiRes16Pixels;
  105.   HiResPixelGroupPtr       = POINTER TO HiResLinePixelGroups;
  106.   HiResScreenLinePtr     = POINTER TO HiResScreenLine;
  107.  
  108.   HiResCharPlane       = ARRAY [ 0 .. 1 ] OF CHAR;
  109.   HiResCharScreenLine      = ARRAY  HiResLinePixelGroups OF HiResCharPlane;
  110.   HiResCharScreen    = ARRAY [ 0 .. HiResMaxY ] OF HiResCharScreenLine;
  111.  
  112.         (*-----------------------------------*)
  113.         (*  Degas picture file description   *)
  114.         (*-----------------------------------*)
  115.  
  116.   DegasPicture = 
  117.     RECORD
  118.       CASE resolution : CARDINAL OF
  119.         LowRes : LowPalette    : Palette;
  120.          CASE :BOOLEAN OF 
  121.                    TRUE  : LowResPicture     : LowResScreen |
  122.                    FALSE : LowResCharPicture     : LowResCharScreen |
  123.          END; |
  124.  
  125.         MedRes : MedPalette    : Palette;
  126.          CASE :BOOLEAN OF 
  127.                    TRUE  : MedResPicture     : MedResScreen |
  128.                    FALSE : MedResCharPicture    : MedResCharScreen |
  129.          END; |
  130.  
  131.         HiRes  : HiPalette     : Palette;
  132.          CASE :BOOLEAN OF 
  133.                    TRUE  : HiResPicture     : HiResScreen |
  134.                    FALSE : HiResCharPicture    : HiResCharScreen |
  135.          END; |
  136.       ELSE
  137.       END; 
  138.     END;   
  139.  
  140.  
  141. (*----------------------------------------------------------------------*)
  142. (*  Print pattern conversion types                                      *)
  143. (*----------------------------------------------------------------------*)
  144.  
  145.    PrintBitPatternSet = SET OF  [ 0 .. 3 ] ;
  146.                                         (* print in a square:  0 1  *)
  147.                                         (* ( low -> high )     2 3  *)
  148.                                         (*                          *)
  149.                                         (* print in a rectangle: 0  *)
  150.                                         (* ( medium -> high )    1  *)
  151.  
  152.    PaletteEntry =
  153.      RECORD
  154.        RedComponent,
  155.        GreenComponent,
  156.        BlueComponent   : INTEGER;
  157.        ColourIndex     : INTEGER;
  158.        PrintBitPattern : PrintBitPatternSet;
  159.      END;
  160.  
  161.    PrintPalette =  ARRAY [ 0 .. 15 ] OF PaletteEntry;
  162. (*----------------------------------------------------------------------*)
  163. (* only the first 4 will be used in medium res pictures.                *)
  164. (*----------------------------------------------------------------------*)
  165.  
  166.  
  167. (*----------------------------------------------------------------------*)
  168. (* Subset of complete picture                                           *)
  169. (*----------------------------------------------------------------------*)
  170.   PictureImage =
  171.     RECORD
  172.       StartX, StartY,
  173.       Width,
  174.       Height : INTEGER;
  175.     END;
  176.  
  177.  
  178. (*----------------------------------------------------------------------*)
  179. (* Printed image size ( dots ) & start co-ords ( char units )           *)
  180. (*----------------------------------------------------------------------*)
  181.   PrintImage =
  182.     RECORD
  183.       StartCharX, StartCharY, (* character units *)
  184.       Width,
  185.       Height  (* dots *)    : INTEGER;
  186.  
  187.       QueryLandscapePrint   : BOOLEAN; (* Y/N *)
  188.     END;
  189.  
  190.  (*-----------------------------------------------------------------*)
  191.  (*                      End of Global Types                        *)
  192.  (*-----------------------------------------------------------------*)
  193.  
  194. VAR
  195.     TheWindow    : WindowPtr;
  196. END DCGlobal.
  197.